$picnic-radius: 0;
$picnic-breakpoint: 700px;
$rspacing: 15px;

$primary-color: #f55;

@import "../../node_modules/picnic/src/picnic.scss";
@import "./prism";

@import "./toc";
@import "./nav";

.external {
  box-shadow: none;
  padding-left: 35px;
  margin-top: 35px;
  position: relative;
  background: none;
}

.external::before {
  content: '“';
  font-size: 3.5em;
  font-family: serif;
  line-height: 20px;
  height: 20px;
  position: absolute;
  top: 10px;
  left: 0;
}

article pre,
article pre[class*="language-"] {
  font-size: 1.1em;
  // Same as padding
  margin-left: -$rspacing;
  padding: 10px $rspacing;
  width: calc(100% + #{2 * $rspacing});
}

@media all and (min-width: 900px) {
  article pre,
  article pre[class*="language-"] {
    font-size: 1em;
    margin-top: 0;
    margin-left: 0;
    width: 100%;
    padding: .5em .8em;
    line-height: 1.3;
  }
}

.language-css .token.string,
.style .token.string,
.token.entity,
.token.operator,
.token.url {
  background: none;
}

body {
  font-size: 1em;
  background-image: linear-gradient(135deg, #81c, #18c);
  background-size: cover;
  background-attachment: fixed;
  padding-top: 3em;
}

.hero {
  position: relative;
  width: 100%;
  height: 50%;
  min-height: 300px;
  margin: 0;
  text-align: center;
  color: #fff;
  padding: 1px 0;
  transition: min-height 999999s, height 999999s;
}

.hero .content {
  padding: 10px;
  width: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateY(-50%) translateX(-50%);
  margin: 0 auto;
}

.hero .arrow {
  font-size: .7em;
  font-weight: 100000;
  transform: scaleX(1.3);
  display: inline-block;
  margin: 0 0 0 10px;
}
.hero .button .arrow {
  transform: scaleX(1.3) translateY(-1px);
}
.hero .arrow.left {
  margin: 0 10px 0 0;
}



@import 'article';

.hero h1 {
  font-weight: normal;
  padding: 0;
  margin: 0;
}

.sub {
  margin: 0;
}

pre.sub {
  display: inline-block;
  padding: 5px 15px;
  text-align: left;
  font-size: 1.4em;
  font-family: monospace;
  font-weight: 300;
  border-radius: 0;
  background: rgba(255, 255, 255, .1);
}

@media print {
  body {
    padding: 0;
  }
  nav {
    display: none;
  }
  .hero, .hero .content {
    position: static;
    height: auto;
    min-height: 0;
    top: auto;
    left: auto;
    transform: none;
  }
  .hero .button {
    display: none;
  }
  pre {
    border: 2px solid #ddd;
  }

  #keep-reading,
  #keep-reading ~ * {
    display: none;
  }

  h1::after {
    content: "Tutorial for server.js: https://serverjs.io/";
    display: block;
    font-size: 1rem;
  }

  pre[class*="language-"] {
    position: relative;
    overflow: visible;
    margin-top: 30px;
  }

  pre[class*="language-"]::before {
    content: attr(data-language);
    position: absolute;
    top: 0;
    right: 0;
    font-size: .6em;
    padding: 1px 5px;
    border: 2px solid #ddd;
    border-radius: 0 .4em;
    border-width: 0 0 2px 2px;
  }
}


blockquote {
  padding: 0.3em .3em .3em 1em;
  margin: 1em 0;
  box-shadow: inset 5px 0 rgba(191, 166, 0, 0.3);
  background: #fdfbc8;
}

blockquote.success {
  background: rgba($picnic-success, 0.15);
  box-shadow: inset 5px 0 rgba($picnic-success, 0.3);
}

blockquote.warning {
  background: rgba($picnic-warning, 0.15);
  box-shadow: inset 5px 0 rgba($picnic-warning, 0.3);
}

blockquote.error {
  background: rgba($picnic-error, 0.15);
  box-shadow: inset 5px 0 rgba($picnic-error, 0.3);
}

blockquote *:first-child {
  margin-top: 0;
}

blockquote *:last-child {
  margin-bottom: 0;
}


// The ad above the quote should only be shown in the README.md but in the website there are other sponsoring rules (as per our agreement).
.ad.inline {
  display: none;
}


button.secret {
  display: none;
}

@media all and (min-width: 800px) {
  body {
    font-size: 1.15em;
  }

  .hero .content {
    width: auto;
    max-width: 100%;
  }
  .hero h1 {
    font-size: 2.3em;
  }
  .hero p,
  .sub {
    font-size: 1.2em;
    margin: 5px 0;
  }

  button.secret {
    display: block;
    background: none;
    color: rgba(255, 255, 255, .03);
    margin: 0 auto -50px;
    cursor: inherit;
  }

  button.secret:focus {
    box-shadow: none;
    color: rgba(255, 255, 255, .05);
  }

  button.secret:hover {
    box-shadow: none;
    background: rgba(255, 255, 255, .5);
    color: rgba(0, 0, 0, .5);
    transition: all .3s ease .3s;
  }


  body.liftoff {
    background: #000 url("/img/lanterns.jpg") no-repeat center center scroll;
    background-size: cover;
    transition: all 1s ease;
  }

  body.liftoff .hero {
    background: none;
  }

  .docs {
    padding: .4em 1em;
  }
}

.button {
  background: $primary-color;
}

.hero .button {
  font-weight: bold;
  margin: 0 5px 5px 0;
  background: $primary-color;
}



.pages {
  text-align: center;
  margin: 10px auto 0;
}
.pages .button {
  margin-right: .3em;
}

#keep-reading {
  margin-top: 1em;
}


.become-sponsor {
  display: block;
  background: #eee;
  text-align: center;
  color: #666;
  padding: 20px 0;
}
